﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>MyGame.Sync</title>
    <meta name="apple-mobile-web-app-capable" content="yes" /><meta name="apple-mobile-web-app-status-bar-style" content="black" /><meta name="viewport" content="width=320" />
    <script src="../../vipgames.api.js" type="text/javascript"></script>
    <script src="MyGame.Sync.js" type="text/javascript"></script>
    <style type="text/css">
        body { font-family: Helvetica, Sans-Serif }
        #ConsoleOut { bottom: 0; height: 160px; left: 0; right: 0; background-color: Black; color: White; overflow: auto; font-family: Courier New, Sans-Serif;
                          font-size: small; position: fixed;  }
    </style>
    <script type="text/javascript">
        (function () {
         // override vipgames.utils.log function to log
        var temp = vipgames.utils.log;
        vipgames.utils.log = function () {
            temp.apply(this, arguments);
            var line = "";
            for (var i = 0; i < arguments.length; i++) {
                var obj = arguments[i];
                if (i > 0) line += ", ";
                if (typeof obj == "string")
                    line += obj;
                else
                    line += JSON.stringify(obj);
            }

            var li = document.createElement("li");
            li.appendChild(document.createTextNode(line));
            if (line.match(/ERR.*/)) li.style.color = 'orangered';
            document.getElementById("ConsoleOut").insertBefore(li, document.getElementById("ConsoleOut").childNodes[0]);
        };
    })();

        window.addEventListener('load', function () {
        // hide black log pane if it is a mobile browser
        if (!!navigator.userAgent.match(/iPhone|iPad|iPod|Android|BlackBerry|Nokia/)) {
            document.getElementById('ConsoleOut').style.display = 'none';
            var temp = vipgames.utils.error;
            vipgames.utils.error = function () {
                alert(arguments[0]);
                temp.apply(this, arguments);
            }
        }
    }, false);
    </script>
</head>
<body>

    <div id="vipgames_game_scene" style='position: relative; margin: auto'>
        
    </div>

    <ul id="ConsoleOut"></ul>
</body>
</html>
